package co.baiku.boot.job.model;

import co.baiku.boot.common.tools.StringTools;
import co.baiku.boot.common.validate.annotation.CheckField;

import java.io.Serializable;
import java.util.Map;

public class QuartzJobInfo implements Serializable {
    /**
     * 任务名称
     */
    @CheckField(message = "任务名称不能为空", notEmpty = true)
    private String jobName;
    /**
     * 任务分组
     */
    private String jobGroup;
    /**
     * 任务描述
     */
    @CheckField(message = "任务描述不能为空", notEmpty = true)
    private String jobDescription;
    /**
     * 任务状态
     */
    private String jobStatus;
    /**
     * 任务表达式
     */
    @CheckField(message = "任务表达式", notEmpty = true)
    private String cronExpression;

    private String createTime;

    private Map<String,Object> jobDataMap;

    public QuartzJobInfo() {

    }

    public String getJobName() {
        return jobName;
    }

    public void setJobName(String jobName) {
        this.jobName = jobName;
    }

    public String getJobGroup() {
        return StringTools.nvl(jobGroup,"DEFAULT");
    }

    public void setJobGroup(String jobGroup) {
        this.jobGroup = jobGroup;
    }

    public String getJobDescription() {
        return jobDescription;
    }

    public void setJobDescription(String jobDescription) {
        this.jobDescription = jobDescription;
    }

    public String getJobStatus() {
        return jobStatus;
    }

    public void setJobStatus(String jobStatus) {
        this.jobStatus = jobStatus;
    }

    public String getCronExpression() {
        return cronExpression;
    }

    public void setCronExpression(String cronExpression) {
        this.cronExpression = cronExpression;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public Map<String, Object> getJobDataMap() {
        return jobDataMap;
    }

    public void setJobDataMap(Map<String, Object> jobDataMap) {
        this.jobDataMap = jobDataMap;
    }
}